UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FfaM0T0KADKqIHoND5v9QcADNlD3Q/8K/BxjvaAOmhE=' 
WHERE 
  key_id = 'c0f72eb80aa799e56695874d41cfb2b87cbc50c89610e4f4fac41e0730fa5c90' 
  AND (
    token = 'FfaM0T0KADKqIHoND5v9QcADNlD3Q/8K/BxjvaAOmhE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034