UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8OUG+fcXHFTBe1lRk4kPzy8Q8Ln0Lc+IEv3ZApsOiI=' 
WHERE 
  key_id = 'a5c6a90ddf84c7975eb15b272b6c41fb002467274c118c0de5aec6cf2c564fc5' 
  AND (
    token = 'X8OUG+fcXHFTBe1lRk4kPzy8Q8Ln0Lc+IEv3ZApsOiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047