UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YsjbS5U5mIuL6CjVGuICmM/bIXElUkVWZY5shDfyofk=' 
WHERE 
  key_id = 'c21e58b354af85080887bf963509c898a03db31272f74b13909142e3c8c54bba' 
  AND (
    token = 'YsjbS5U5mIuL6CjVGuICmM/bIXElUkVWZY5shDfyofk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029