UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LrimxMQWygXWM3ISCEY9F7nzuT03MxrA1QPa6HE/WYI='
WHERE
key_id = 'e420362f3b6e4690ac54918bb7cb74f7f88fdfd6ac88fea11e20c281deb4bbe9'
AND (
token = 'LrimxMQWygXWM3ISCEY9F7nzuT03MxrA1QPa6HE/WYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)