UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YtzTxnAI3Vode7ncQRcSqln0MM8cpFKqHhbD97TAIJ0=' 
WHERE 
  key_id = '372a4b4e9fced44f825825fde547aba4e60a55892cf28e2eb863e4cbe3e54c51' 
  AND (
    token = 'YtzTxnAI3Vode7ncQRcSqln0MM8cpFKqHhbD97TAIJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031