UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GEE1z6rndYvpRQlqXVs9U5oWfG9uALL7qocRLBwVdGI='
WHERE
key_id = '7ea29453f18335cfb3a9d6cd6b1ff4ce98615f5ba96bfc16aaa6db1e8e11c707'
AND (
token = 'GEE1z6rndYvpRQlqXVs9U5oWfG9uALL7qocRLBwVdGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)