UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GbyvkUoONMPEkWdv2wEysoKu65b/IYPK0rle8P9tNa8='
WHERE
key_id = 'cdb20e6391698e0678aa6f2e9b8d9cde4864f673568df7e31c3afc6592a1bc15'
AND (
token = 'GbyvkUoONMPEkWdv2wEysoKu65b/IYPK0rle8P9tNa8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)