UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CWpHlXChv5mEIXOFlw/x4hCkNF6nEAirLBAB7hq43C4=' 
WHERE 
  key_id = 'dd649187596072d11d1b418faef18ffc039305e0b5b4fa312623b5c278e980c2' 
  AND (
    token = 'CWpHlXChv5mEIXOFlw/x4hCkNF6nEAirLBAB7hq43C4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047