UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F5QAwWDP3k/Q3Umo2TtTun2st1TRpr8VeOTYQgCvKBs='
WHERE
key_id = '6390ebadb332d004706adeded539e078f245b18cb834671ee9fe5d9f61361c7b'
AND (
token = 'F5QAwWDP3k/Q3Umo2TtTun2st1TRpr8VeOTYQgCvKBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)