UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4wk3oaMFpElC5j6ykS7rd11de02eMuExPURocYjIbfY=' 
WHERE 
  key_id = '773eb613504bada9bdd4da9bb819c2f5c5a5ac4e0d0b576b5c0425361f06122c' 
  AND (
    token = '4wk3oaMFpElC5j6ykS7rd11de02eMuExPURocYjIbfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036