UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yCIlB0H/i8rYqynZql/x1qfdozhynPadt8vjj7IC1ks=' 
WHERE 
  key_id = 'c7bf3d5469457e467398808bbb96c6d697ce3646076a6fd21d21d191a9a81c08' 
  AND (
    token = 'yCIlB0H/i8rYqynZql/x1qfdozhynPadt8vjj7IC1ks=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030