UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N3+QkTXDBZdhkxxVAb9QY6eJKG723KcKqXBp7/MLUPM='
WHERE
key_id = '85cebfb1b8701beacdfd0564764629e52d543bf181a32c44f0e5ba0e748e003e'
AND (
token = 'N3+QkTXDBZdhkxxVAb9QY6eJKG723KcKqXBp7/MLUPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)