UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FxoUPjomuaTTjmb8y8FEYdItocBircLyhTsrvU/MJhQ=' 
WHERE 
  key_id = '808ea0d4d724ce08987c2d42cf53cab38e63dc836e829e75278c9b94b3980922' 
  AND (
    token = 'FxoUPjomuaTTjmb8y8FEYdItocBircLyhTsrvU/MJhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053