UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xZbA+AK1djjWUindu8TBeKR5j5zQX5IQ6Om6fBw8NY=' 
WHERE 
  key_id = '2f391b416a922f50bfd4848519fdeb8a75000387b6eb47e8674261197bdd6b58' 
  AND (
    token = '8xZbA+AK1djjWUindu8TBeKR5j5zQX5IQ6Om6fBw8NY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013