UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fbHJm9GggCWkBkVI0thbgeNJXkmAiQ5OFVH05UbEtLo=' 
WHERE 
  key_id = '34112577c02d735ce569492eab67470b11b9aca1f4a14177243110c89200293e' 
  AND (
    token = 'fbHJm9GggCWkBkVI0thbgeNJXkmAiQ5OFVH05UbEtLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029