UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIpL4ZWvAQGp3jV6jZC18zetZItBNG0pQCHJrFnQpPw='
WHERE
key_id = 'aedab7110562b0406aba09b992388bfacf08918edfe76ec0b16299c65c381bb5'
AND (
token = 'GIpL4ZWvAQGp3jV6jZC18zetZItBNG0pQCHJrFnQpPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)