UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvLw8oCfh5K0SMarWt4scURUnE2m0NJeHFHhJWNVmu4=' 
WHERE 
  key_id = 'b52ef5a60fd314ad330a1b3547e57ce2ac6e7c27e12be323804b92ccfd844e90' 
  AND (
    token = 'QvLw8oCfh5K0SMarWt4scURUnE2m0NJeHFHhJWNVmu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027