UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5sYu5/4TESrdxanO4i5DmD/BYThPlCFzm/5PXn2SJoE=' 
WHERE 
  key_id = '32cace16ef0f195d414a8821548293dc5c463962d67741152a56ea201b926c37' 
  AND (
    token = '5sYu5/4TESrdxanO4i5DmD/BYThPlCFzm/5PXn2SJoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030