UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FrE1YQNumLsCb9W/Qv0OWYu/QRt2sAbU0DcT84EroMU='
WHERE
key_id = 'ead72c67f0515e95687c76f0f7a81f0f4c4310cef9ffb75c75d4d7e40d973c40'
AND (
token = 'FrE1YQNumLsCb9W/Qv0OWYu/QRt2sAbU0DcT84EroMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)