UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zXjfFP+/C95igFYXplkrEhEBlVasa4JJGjbSf0gr2IQ=' 
WHERE 
  key_id = 'ec2073216b38fd7cc303099adfc808bc918667f4ab28388fc74e252d2874cc0d' 
  AND (
    token = 'zXjfFP+/C95igFYXplkrEhEBlVasa4JJGjbSf0gr2IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050