UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oqXtIE2MzkXQb/9qfdpVy1j3Al70wBkU8ztOdSc5qec='
WHERE
key_id = '85ab2f1513e348566fc735f84637254b378082492c29d9d08590275dc9ee6413'
AND (
token = 'oqXtIE2MzkXQb/9qfdpVy1j3Al70wBkU8ztOdSc5qec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)