UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9VNEctHTcfQmnYNLU871eM7sYNWEZ1vsDvQFx1n9i6g=' 
WHERE 
  key_id = '80e349f3e6060a7eb27d8da12975574ff8d738470004727f8bbbd835e43254e9' 
  AND (
    token = '9VNEctHTcfQmnYNLU871eM7sYNWEZ1vsDvQFx1n9i6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025