UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvyUORLNQw4wCAAVyGxnUyfU7rwvQb7ZZIs/sQwkWJE=' 
WHERE 
  key_id = 'c97d34d297c8dcfb071c2e2c11bfc8f80db5dfc84348c620832ba2c2031f333c' 
  AND (
    token = 'xvyUORLNQw4wCAAVyGxnUyfU7rwvQb7ZZIs/sQwkWJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046