UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'krWUcaRUAXhJGTKFtseFFy/9ruRaQdemCe35CifyAOY='
WHERE
key_id = '167365b553a61a5a2a9020621ae24d4bdc8d81bec0563c40d489034ab3e92b2c'
AND (
token = 'krWUcaRUAXhJGTKFtseFFy/9ruRaQdemCe35CifyAOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)