UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tf98i5vKxE8HyjBRftvLgbUX1gE/FmxhEsmmDAEVxKc=' 
WHERE 
  key_id = '3cb405709e91f14592c8b383c1d7150c36a8cadb4ca27a3f5d60b9b02ed48edc' 
  AND (
    token = 'Tf98i5vKxE8HyjBRftvLgbUX1gE/FmxhEsmmDAEVxKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017