UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '99pu3DOnOnWZGVsIHqa681Ml1XGSOhTU2dgERCgKP8E=' 
WHERE 
  key_id = 'e2beb681e4a1a8d3810c9673556fd807fbf88749ea4c3bf8801adf159481706e' 
  AND (
    token = '99pu3DOnOnWZGVsIHqa681Ml1XGSOhTU2dgERCgKP8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038