UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dqUQZJvQNyJUSoJMcWK0Z3vRiNOq+2xuK+MJWcm1Oy0='
WHERE
key_id = '678ae2fed149cf99c7201cd201a2bb262b821e1eba5c9d1be8cdb3f9be72be01'
AND (
token = 'dqUQZJvQNyJUSoJMcWK0Z3vRiNOq+2xuK+MJWcm1Oy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)