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