UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIYxbTi+Jro7lObm8Y/XJjxtn5LIPTuiehx3rpW2Khc='
WHERE
key_id = '8f74293e9af3484b902b80aa0eef435569503852fc0cb10eba90fa67380ef3e3'
AND (
token = 'GIYxbTi+Jro7lObm8Y/XJjxtn5LIPTuiehx3rpW2Khc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)