UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7luuigVOljILyD85VLc5bfTLfZSGAsPkVDlWhQG6k4='
WHERE
key_id = '3bee046fee31e2efb3ce0700106964114fa257af870dd7a5fa8945c118d1711b'
AND (
token = 'R7luuigVOljILyD85VLc5bfTLfZSGAsPkVDlWhQG6k4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)