UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '36LuW0sGeU+cCRcP/VS6CHw8rSphRf7wus3ULgSyXsg='
WHERE
key_id = 'b241db61ca96f7dbd7febb4673da87823f480369e73ba792d68ee34cba560bd7'
AND (
token = '36LuW0sGeU+cCRcP/VS6CHw8rSphRf7wus3ULgSyXsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)