UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xi++IQqDFuGB01xtDPM/5opOWAimNTxXlrqbGarOeRQ='
WHERE
key_id = 'd2a729370bba6c4704aedad38f9917954f0b5935529bd2b7fb37c85d3d507ae9'
AND (
token = 'Xi++IQqDFuGB01xtDPM/5opOWAimNTxXlrqbGarOeRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)